package com.kjw.learn.springboot.chapter3.service.impl;

import com.kjw.learn.springboot.chapter3.mapper.ZuFangMapper;
import com.kjw.learn.springboot.chapter3.service.ZuFangService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * @Author: KuangJieWen
 * @Date: 2018/1/23 11:22
 * @Description:天河租房Service的实现
 */
@Service
public class ZuFangServiceImpl implements ZuFangService {
    @Autowired(required = false)
    private ZuFangMapper zuFangMapper;
    @Override
    public List<Map> getAll() {
        return zuFangMapper.getAll();
    }

    @Override
    @Transactional
    public int save(Map param) {
        zuFangMapper.save(param);
        zuFangMapper.save(param);
        return 1;
    }
}
